

####################################################################
######################## Figure 5#####################################
####################################################################





data_q<-read.csv("data_fig_5.csv")



#setwd("~/Dropbox/Job Market Paper/IO Revisions/Replication_Files/Figure_5")




years<-as.numeric(as.character(unique(data_q$Year)))


CE<-subset(data_q,data_q$CE==1)

NCE<-subset(data_q,data_q$CE==0)

mean_Ltsnce<-as.ts(tapply(NCE$logArea,NCE$Year,mean))


names_tsnce<-tapply(NCE$ID,NCE$Year,length)

mean_Ltsce<-as.ts(tapply(CE$logArea,CE$Year,mean))
names_tsce<-tapply(CE$ID,CE$Year,length)

dev.new(width = 5, height = 7.5)

pdf(file="Figure_5.pdf")

par(mfrow=c(2,1))

plot(years,names_tsce,type="l", xlab="",ylab="Number of States",main="The Number and Size of States",axes=F,lwd=2)

axis(2,at=seq(0,200,by=50))

lines(years,names_tsnce,lty=2,lwd=2)


text(1790,190,"Core",cex=.5)
text(1790,60,"Periphery",cex=.5)

#text(1290,65,"Number of States",cex=.5)
#text(1240,160,"Average Size",cex=.5)
#par(new=T)


plot(years,mean_Ltsce-mean(log(CE$Area)),type="l", ylab="Trend in Size",xlab="Year",main="",lty=1,axes=F,lwd=2,ylim=c(-.75,1.25))

lines(years,mean_Ltsnce-mean(log(NCE$Area)),lty=2,lwd=2)

axis(2,at=seq(-1,1.5,by=.25))

axis(1,at=seq(1100,1800,by=100))

dev.off()

